﻿#region Copyright

// /*
// SilverlightInEnterprise
// SilverlightInEnterprise.SharedCode.Repository
// Product.cs
// 
// Author: Matt Van Horn
// Created 11/17/2011 3:15 PM
// Copyright: Silverlight in the Enterprise www.slinenterprise.com
// 
// Licensed under MS-PL http://www.opensource.org/licenses/MS-PL and while you 
// may use this in anyway you see fit and owe us nothing to do so, we wouldn't mind knowing that you got value out of the work we did (so we will do more) so 
// we ask that you leave a comment on www.slinenterprise.com or on the codeplex site slinenterprise.codeplex.com
// 
// */

#endregion

using System.Runtime.Serialization;

namespace SilverlightInEnterprise.SharedCode.Repository.Models
{
    [DataContract]
    public partial class Product
    {
        [DataMember]
        public int Id { get; set; }

        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string ProductCode { get; set; }

        public override string ToString()
        {
            return this.Name;
        }

        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            return this.Id == (obj as Product).Id;
        }
    }
}